import React, {Component} from "react";
import {
	TouchableOpacity,
	Text,
	Alert,
} from "react-native";

export default class AlertExm extends Component {
	constructor(props) {
		super(props);
	}
	_onPress() {
		Alert.alert(
			"提示",
			"您确定要删除该项内容吗？",
			[
				{ text: "稍后询问我", onPress: () => console.log("稍后询问我") },
				{ text: "取消", onPress: () => console.log("取消") },
				{ text: "确定", onPress: () => console.log("确定") }
			],
			{ onDismiss: () => {console.log("点击弹出框意外的地方调用的事件")} },
			{cancelable: false}

		)
	}
	render() {
		return (
			<TouchableOpacity onPress={this._onPress}>
				<Text>点击</Text>
			</TouchableOpacity>
		);
	}
}